<template>
	<el-dropdown @command="handleOperate">
		<div class="title-menu">
			<el-icon class="icon">
				<icon-more-app theme="outline" :strokeWidth="2" />
			</el-icon>
		</div>
		<template #dropdown>
			<el-dropdown-menu>
				<el-dropdown-item v-for="(item, index) in list" :key="index" :command="index">
					<el-button text :type="item.type" v-auth="item.auth">
						{{ item.label }}
					</el-button>
				</el-dropdown-item>
			</el-dropdown-menu>
		</template>
	</el-dropdown>
</template>

<script setup lang="ts">
type Props = {
	list?: any
}
const emits = defineEmits(['change'])
const props = withDefaults(defineProps<Props>(), {})
const handleOperate = (command: string | number) => {
	emits('change', props.list[command])
}
</script>

<style scoped></style>
